Repository navigation
Msys2 detect / ofMenu / vs - #8657
Merged
Merged
Conversation
Fixes openframeworks#8640. Running of.sh from an MSYS2 UCRT64 / CLANG64 / CLANGARM64 shell was detected as "vs / 64" and setup downloaded the Visual Studio libs. - Git for Windows has git-bash.exe at its root, MSYS2 doesn't. Git Bash (which also sets MSYSTEM=MINGW64) stays vs; an MSYS2 shell (pacman, or MSYSTEM ucrt64|clang64|clangarm64|mingw64) is now msys2 with OF_ARCH set to that environment. The plain MSYS shell falls back by CPU: clangarm64 on ARM64 (read from the registry, since MSYS2's own bash is emulated x64 there), ucrt64 on x64. - Choosing msys2 in the libs menu now asks for the MSYS2 environment: the detected one first (default), then clangarm64, ucrt64, clang64. - runLibsDownload passes the msys2 env to download_libs as -a, so the package matches the chosen env even from Git Bash, scoped to that download so it doesn't leak into a later vs download in the same session.
Git Bash (and MSYS2's own bash) run as emulated x64 on Windows on ARM and report PROCESSOR_ARCHITECTURE=AMD64 / uname -m x86_64, so ofMenu showed "vs / 64" on ARM64 machines. hostIsArm64 now reads the native CPU from the registry first (not emulated), then MSYSTEM / PROCESSOR_ARCHITEW6432 / uname; detectHostVsArch and the msys2 env default both use it. On ARM64 the vs libs default becomes arm64 (download_libs pulls x64 + arm64 + arm64ec).
MSYS2 doesn't ship git, so ofHasGit failed and the menu showed a git checkout as "nightly package (no .git)" and offered clone. When git isn't on PATH, fall back to Git for Windows' git.exe (Program Files or the per-user install). Without any git, a folder with .git is reported as "git checkout (git not found — pacman -S git)" and clone is only offered when there is no .git at all. The vsconfig() menu entry is now shown for the vs platform only, not in MSYS2 shells (`of vsconfig` still works from any Windows shell).
Member
Author
Qwen Testing (Windows 11 ARM64, Git for Windows + MSYS2)
|
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes: #8640
MSYS2 terminal:
of.sh: detect MSYS2 shells as msys2, pick the MSYS2 env in the menu
Fixes #8640
Problem
When
of.shruns from an MSYS2 UCRT64 / CLANG64 / CLANGARM64 shell, ofMenu reportsvs / 64, and setup downloads the Visual Studio libs instead of the msys2 ones.Changes (
scripts/of.shonly)Detection
/git-bash.exepresent,MSYSTEM=MINGW64) on x64git-bash.exe/git-cmd.exeat its root, as suggested in the issue.MSYSTEMalone can't separate the two, because Git Bash also setsMSYSTEM=MINGW64.pacman, or byMSYSTEMbeingucrt64|clang64|clangarm64|mingw64.Native ARM64 detection
PROCESSOR_ARCHITECTURE=AMD64/uname -m x86_64. That's why ARM64 machines showedvs / 64.hostIsArm64now reads the native CPU from the registry first (HKLM\…\Session Manager\Environment\PROCESSOR_ARCHITECTURE, which is not emulated). It then falls back toMSYSTEM,PROCESSOR_ARCHITEW6432anduname.detectHostVsArchand the msys2 environment default both use it. On ARM64 the vs libs default becomesarm64, which makesdownload_libspull x64 + arm64 + arm64ec.Menu: choosing
msys2libraries now asks for the environmentclangarm64/ucrt64) is listed first, marked(default).mingw64is listed only when it's the detected environment.Downloads
download_libsas-a <env>. That way, picking msys2 from Git Bash no longer falls back to Git Bash'sMSYSTEM=MINGW64.vsdownload in the same menu session.LIB_ARCHthe user sets explicitly (LIB_ARCH=clang64 of update libs msys2) is still respected.LIB_ARCH=ucrt64|clang64|clangarm64|mingw64for msys2.MSYS2 without git
nightly package (no .git)and offeredclone().gitisn't on PATH,of.shnow uses Git for Windows'git.exe(Program Files or the per-user install). MSYS2 converts the/c/…path arguments for it..gitshowsgit checkout (git not found — pacman -S git).clone()is offered only when there's no.gitat all.Menu
vsconfig()is shown only for thevsplatform, not in MSYS2 shells.of vsconfigstill works from any Windows shell.Windows ARM64